package src;

import java.util.Arrays;

public class Utils {
    public void generate_matrix(byte[] matrix, int initial, int width, int height){
        for (int i = 0; i < width * height; i++) {
            matrix[i] = (byte)((i + initial) % 0xFF);
        }
    }

    public int compare_generated_matrix(byte[] matrix, int initial, int width, int height){
        for (int i = 0; i < width * height; i++) {
            if (matrix[i] != (byte)((i + initial) % 0xFF)) {
                return 0;
            }
        }
        return 1;
    }

    public int compare_matrix(byte[] first, byte[] second){
        return (Arrays.equals(first,second) ? 1 : 0 );
    }

}
